package com.eliza.kotlin.design.creation.factory.abstract_5

/**
 * @version v1.0
 * @ClassName: DessertFactory
 * @Description: TODO(一句话描述该类的功能)
 * @Author: 黑马程序员
 */
interface DessertFactory {
    //生产咖啡的功能
    fun createCoffee(): Coffee

    //生产甜品的功能
    fun createDessert(): Dessert
}

internal class ItalyDessertFactory : DessertFactory {
    override fun createCoffee(): Coffee {
        return LatteCoffee()
    }

    override fun createDessert(): Dessert {
        return Trimisu()
    }
}

internal class AmericanDessertFactory : DessertFactory {
    override fun createCoffee(): Coffee {
        return AmericanCoffee()
    }

    override fun createDessert(): Dessert {
        return MatchaMousse()
    }
}